package cn.kbyue.swagger3.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * swagger
 *
 * @author xl
 * @date 2020/8/19 23:55
 */
@Configuration
@EnableOpenApi
public class Swagger3Config {

    @Bean
    public Docket swaggerDocket() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("KBblog swagger2 Restful Api Document")
                .description("KBblog 方便查询的Restful Api")
                .contact(new Contact("kbyue", "https://kbyue.cn", "2216941582@qq.com"))
                .version("1.0")
                .build();
    }

}
